
package com.pp.admin.common.client.beans;

import java.io.Serializable;

import com.pp.admin.common.client.PermissionNode;

public class LoginUserInfo implements Serializable {
	
	/**
	 * 
	 */
	private static final long	serialVersionUID	= -3420871173634663450L;
	
	private String				userID;
	
	private boolean				superuser;
	
	private String				currentDomainID;
	
	private PermissionNode		rootPermissionNode;
	
	public LoginUserInfo() {

	}
	
	public LoginUserInfo( String userID, String domainID ) {

		this.userID = userID;
		this.currentDomainID = domainID;
		this.superuser = false;
	}
	
	public LoginUserInfo( String userID ) {

		this.userID = userID;
	}
	
	public String getUserID() {

		return userID;
	}
	
	public void setUserID( String userID ) {

		this.userID = userID;
	}
	
	public boolean isSuperuser() {

		return superuser;
	}
	
	public void setSuperuser( boolean superuser ) {

		this.superuser = superuser;
	}
	
	public String getCurrentDomainID() {

		return currentDomainID;
	}
	
	public void setCurrentDomainID( String currentDomainID ) {

		this.currentDomainID = currentDomainID;
	}
	
	public boolean checkForPermission( String permissionStr ) {

		return rootPermissionNode.checkPermission( permissionStr );
	}
	
	public String toString() {

		return this.userID;
	}
}
